package com.itboye.system.helper;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * Created by hebidu on 16/5/11.
 */
public class ByConsoleHelper {

    private static final Logger logger = LogManager.getLogger(ByConsoleHelper.class.toString());

    /**
     * 运行信息
     * @param info
     * @param logger
     */
    public static void info(String info,Logger logger) {
        System.out.println("[INFO] " + info);
        if (logger == null) {
            ByConsoleHelper.logger.info(info);
        } else {
            logger.info(info);
        }
    }

    /**
     * 调试
     * @param info
     * @param logger
     */
    public static void debug(String info, Logger logger) {
        System.out.println("[DEBUG] " + info);
        if (logger == null) {
            ByConsoleHelper.logger.info(info);
        } else {
            logger.info(info);
        }
    }


}
